using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;

namespace ComBrowser
{
	public partial class NavChapterViewController : UIViewController
	{
		int SelectedBookID = 0;
		FlipperViewController flipViewController;
		#region Constructors

		// The IntPtr and initWithCoder constructors are required for controllers that need 
		// to be able to be created from a xib rather than from managed code

		public NavChapterViewController (IntPtr handle) : base(handle)
		{
			Initialize ();
		}

		[Export("initWithCoder:")]
		public NavChapterViewController (NSCoder coder) : base(coder)
		{
			Initialize ();
		}

		public NavChapterViewController (int SelectedBookID, FlipperViewController ctrl) : base("NavChapterViewController", null)
		{
			this.flipViewController = ctrl;
			this.SelectedBookID = SelectedBookID;
			Initialize ();
		}

		void Initialize ()
		{
			this.View = new NavChapterView (SelectedBookID, this);
		}

		#endregion

		public void SwitchBackToBookView (int SelectedBookID)
		{
			this.flipViewController.SwitchBackToBookView (SelectedBookID);
		}
		

		public void ChapterPicked (int selectedBookID, int ChapterID)
		{
			this.flipViewController.ChapterPicked (selectedBookID, ChapterID);
		}
	}
}

